package  
{
	import bulletbehavior.AccelerateRelativeBehavior;
	import bulletbehavior.DieBehavior;
	import bulletbehavior.HomeTargetBehavior;
	import bulletbehavior.RotateBehavior;
	import bulletbehavior.SplitBehavior;
	import bulletbehavior.WaveBehavior;	
	import turrets.BurstTurret;
	/**
	 * ...
	 * @author morgan
	 */
	public class TestStageState extends GameState
	{
		
		public function TestStageState() 
		{
			
		}
		
		override public function setupBoss():void 
		{
			var pattern0:BulletPattern = new BulletPattern();			
			var pattern1:BulletPattern = new BulletPattern();
			var split360:BulletPattern = new BulletPattern();	
			var startHoming:BulletPattern = new BulletPattern();
			var briefHome:BulletPattern = new BulletPattern();
			var spinAccel:BulletPattern = new BulletPattern();
			
			spinAccel.addBehavior(new RotateBehavior(0, 90));
			spinAccel.addBehavior(new AccelerateRelativeBehavior(100, 0));
			
			split360.addBehavior(new SplitBehavior(24, 40, 0, 360, spinAccel, -1));
			split360.addBehavior(new DieBehavior());	
			
			pattern0.addBehavior(new SplitBehavior(8, 100, 0, 360, briefHome, 0), 1);
			pattern0.addBehavior(new RotateBehavior(10), 1);
			pattern0.addBehavior(new SplitBehavior(8, 80, 0, 360, briefHome, 1), 1);
			pattern0.addBehavior(new RotateBehavior(10), 1);
			pattern0.addBehavior(new SplitBehavior(8, 60, 0, 360, briefHome, 2), 1);
			pattern0.addBehavior(new DieBehavior(), 1);
			
			startHoming.addBehavior(new HomeTargetBehavior(player), 0, 1);
			startHoming.addBehavior(new AccelerateRelativeBehavior(100, 0), 1);
			
			briefHome.addBehavior(new HomeTargetBehavior(player, 9), 0, 0.4);
			
			var bossPattern0:BossPattern = new BossPattern();
			bossPattern0.addTurretTime(0, 1, new Turret(50, 50, startHoming, 1, 80, 50, 0.2));
			bossPattern0.addTurretTime(1, 2, new Turret(63, 50, startHoming, 2, 90, 50, 0.2));
			bossPattern0.addTurretTime(2, 3, new Turret(76, 50, startHoming, 0, 100, 50, 0.2));
			
			var bossPattern1:BossPattern = new BossPattern();
			bossPattern1.addTurretTime(0, 4, new Turret(63, 50, pattern0, 0, 90, 30, 1.0));
			bossPattern1.setPatternLength(5);
			
			var bossPattern2:BossPattern = new BossPattern();
			bossPattern2.addTurretTime(0, Number.MAX_VALUE, new BurstTurret(63, 50, split360, 0, 0, 0, 4, 3, 0.5));
			//bossPattern2.addTurretTime(0.1, Number.MAX_VALUE, new BurstTurret(43, 50, split360, 1, 0, 0, 4, 3, 0.5));
			//bossPattern2.addTurretTime(0.2, Number.MAX_VALUE, new BurstTurret(83, 50, split360, 2, 0, 0, 4, 3, 0.5));
			
			//boss.addState(new BossState(2000, bossPattern2));
			boss.addState(new BossState(500, bossPattern0));
			boss.addState(new BossState(500, bossPattern1));
		}
		
	}

}